package ch14_advanced_gui;
import javax.swing.*;

import java.awt.*;
public class JDemoGridLayout extends JFrame
{
   private JButton b1 = new JButton("Button 1");
   private JButton b2 = new JButton("Button 2");
   private JButton b3 = new JButton("Button 3");
   private JButton b4 = new JButton("Button 4");
   private JButton b5 = new JButton("Button 5");
   private GridLayout layout = new GridLayout(3, 2, 5, 5);
   public JDemoGridLayout()
   {
      setLayout(layout);
      add(b1);
      add(b2);
      add(b3);
      add(b4);
      add(b5);
      setVisible(true);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setSize(200, 200);
   }
   public static void main(String[] args)
   {
       JDemoGridLayout frame = new JDemoGridLayout();
   }
}
